package com.bayair.doctor.ui.inquiry_record;

import android.os.Handler;
import android.os.Looper;
import com.tencent.qcloud.tim.uikit.modules.conversation.base.ConversationInfo;

import java.util.ArrayList;

public class SessionHelper {

    public static void customConversation(final SessionLayout layout) {
        // 动态插入，删除Item，包括自定义会话
        final ConversationInfo customInfo = new ConversationInfo();
        customInfo.setType(ConversationInfo.TYPE_CUSTOM);
        customInfo.setId("自定义会话");
        customInfo.setGroup(false);
        customInfo.setTitle("乔丹风行8代跑鞋 风随我动！");
        //customInfo.setIconUrl();
        ArrayList<Object> objects = new ArrayList<>();objects.add("https://img1.gtimg.com/ninja/2/2019/03/ninja155375585738456.jpg");
        customInfo.setIconUrlList(objects);


        new Handler(Looper.getMainLooper()).postDelayed(new Runnable() {
            @Override
            public void run() {
                layout.addConversationInfo(0, customInfo);
            }
        }, 3000);

        new Handler(Looper.getMainLooper()).postDelayed(new Runnable() {
            @Override
            public void run() {
                layout.removeConversationInfo(0);
            }
        }, 5000);
    }
}
